﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Detail.ascx.vb" Inherits="Control_QuanLyHoSo_Detail" %>
<%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
<%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
<%@ Register Assembly="ValidationTextBox" Namespace="ValidationTextBox.CustomControls"
    TagPrefix="cc1" %>
<%@ Register Assembly="ValidationDropdownlist" Namespace="ValidationDropdownlist.CustomControls"
    TagPrefix="cc2" %>
<style type="text/css">
    .fontuppercase {
        text-transform: uppercase;
        font-weight: bold;
    }

    .margin-detail {
        margin: 10px 0px;
    }

    .hidden {
        display: none;
    }
</style>
<script type="text/javascript">
    function ktraCMND() {
        var check = 1;
        if ($("#<%= txtOwCardId.ClientID %>").val() == '') {
            $("#<%= txtOwCardId.ClientID %>").addClass("mandatory");
            check = 0;
        }
        else {
            //check cmnd
            var cmndReg = /^(\d{9}|\d{12})$/; //CMND        
            if (!cmndReg.test($("#<%= txtOwCardId.ClientID %>").val())) {
                $("#<%= txtOwCardId.ClientID %>").removeClass('normal');
                $("#<%= txtOwCardId.ClientID %>").addClass('mandatory');
                check = 0;
            } else {

                $("#<%= txtOwCardId.ClientID %>").removeClass('mandatory');
                $("#<%= txtOwCardId.ClientID %>").addClass('normal');
            }
            //end check cmnd

        }

        if ($("#<%= txtOwCardDate.ClientID %>").val() == '') {
            $("#<%= txtOwCardDate.ClientID %>").addClass("mandatory");
            check = 0;
        }
        else {
            $("#<%= txtOwCardDate.ClientID %>").removeClass("mandatory");

        }

        if ($("#<%= ddlDeptCertified.ClientID %>").val() == '') {
            $("#<%= ddlDeptCertified.ClientID %>").addClass("mandatory");
            check = 0;
        }
        else {
            $("#<%= ddlDeptCertified.ClientID %>").removeClass("mandatory");

        }
        return check;
    }

    function ktraGTK() {
        var check = 1;
        if ($("#<%= ddlOthersPaper.ClientID %>").val() == '') {
            $("#<%= ddlOthersPaper.ClientID %>").addClass("mandatory");
            check = 0;
        }
        else {
            $("#<%= ddlOthersPaper.ClientID %>").removeClass("mandatory");
        }
        if ($("#<%= txtOtherPaperCode.ClientID %>").val() == '') {
            $("#<%= txtOtherPaperCode.ClientID %>").addClass("mandatory");
            check = 0;
        }
        else {
            $("#<%= txtOtherPaperCode.ClientID %>").removeClass("mandatory");
        }
        if ($("#<%= txtOthersPaperDateIssue.ClientID %>").val() == '') {
            $("#<%= txtOthersPaperDateIssue.ClientID %>").addClass("mandatory");
            check = 0;
        }
        else {
            $("#<%= txtOthersPaperDateIssue.ClientID %>").removeClass("mandatory");
        }
        if ($("#<%= ddlOthersPaper_NoiCap.ClientID %>").val() == '') {
            $("#<%= ddlOthersPaper_NoiCap.ClientID %>").addClass("mandatory");
            check = 0;
        }
        else {
            $("#<%= ddlOthersPaper_NoiCap.ClientID %>").removeClass("mandatory");
        }
        return check;
    }
    //start function=========================================================//
    function ajaxJquery() {
        $(function () {

            ////Disabled
            //$('#Detail [type=text], #Detail select ,#Detail [type=radio],#Detail textarea,#Detail [type=checkbox], #Detail [type=button]').each(function (e) {
            //    $(this).attr("disabled", "disabled");
            //});


            $("#B1").click(function () {
                $("#ViewList").hide();
                $("#List").hide();
                $("#Detail").show();
                $("#B2").removeClass("active")
                $("#B1").addClass("active")
                return false;
            });
            $("#B2").click(function () {
                $("#Detail").hide();
                $("#ViewList").show();
                $("#List").show();
                $("#B1").removeClass("active")
                $("#B2").addClass("active")
                return false;
            });
            //Kiem tra ten ho kinh doanh --->
            $("#<%= btnCheckTenHo.ClientID %>").click(function () {

                var sName = $("#<%= txtBizName.ClientID %>").val();
                var iHuyen = $("#<%= hidCurHuyenId.ClientID %>").val();
                $.ajax({
                    type: "POST", //Phuong thuc truyen du lieu luon la POST
                    url: '<%=ResolveUrl("~/Services/swCheckData.asmx/CheckTenHo")%>',
                    data: "{'strTenHo': '" + sName + "','intHuyen':'" + iHuyen + "'}", //thong so truyen vao
                    dataType: "", //kieu du lieu tra ve
                    contentType: "application/json; charset=utf-8",
                    success: function (result) {

                        var resultReturn = eval("(" + result.d + ")");

                        if (resultReturn == "0") {
                            alert("Tên hộ kinh doanh đã tồn tại trong huyện.");
                            $("#<%= txtBizName.ClientID %>").select();
                            $("#<%= txtBizName.ClientID %>").focus();



                        } else {
                            alert("Tên hộ kinh doanh hợp lệ.");

                        }

                    }, //ham thuc thi neu thanh cong    
                    error: function () {
                        alert("Có lỗi xảy ra. Vui lòng kiểm tra đường truyền");
                    } //ham thuc thi neu loi xay ra.

                });
            });
            //Kiem tra ten ho kinh doanh <---
            //Kiem tra CMND --->
            $("#<%= btnCheckCMND.ClientID %>").click(function () {

                var sName = $("#<%= txtOwCardId.ClientID %>").val();
                var iHuyen = $("#<%= hidCurHuyenId.ClientID %>").val();
                $.ajax({
                    type: "POST", //Phuong thuc truyen du lieu luon la POST
                    url: '<%=ResolveUrl("~/Services/swCheckData.asmx/CheckCardId")%>',
                    data: "{'strCarId': '" + sName + "','intHuyen':'" + iHuyen + "'}", //thong so truyen vao
                    dataType: "", //kieu du lieu tra ve
                    contentType: "application/json; charset=utf-8",
                    success: function (result) {

                        var resultReturn = eval("(" + result.d + ")");

                        if (resultReturn == "0") {
                            alert("Số chứng minh nhân dân đã tồn tại trong hệ thống.");
                            $("#<%= txtOwCardId.ClientID %>").select();
                            $("#<%= txtOwCardId.ClientID %>").focus();



                        } else {
                            alert("Số chứng minh nhân dân hợp lệ.");

                        }

                    }, //ham thuc thi neu thanh cong    
                    error: function () {
                        alert("Có lỗi xảy ra. Vui lòng kiểm tra đường truyền");
                    } //ham thuc thi neu loi xay ra.

                });
            });
            //Kiem tra CMND <---
            //chuyen chu hoa--->
            $("#<%=txtBizName.ClientID %>").keyup(function () {
                $(this).val($(this).val().toUpperCase());
            });
            $("#<%=txtOwRepresentative.ClientID %>").keyup(function () {
                $(this).val($(this).val().toUpperCase());
            });
            //chuyen chu hoa<----
            var _gtk = $('#gtk')
            var _cmnd = $('#cmnd')
            //click vào link cmnd hidden div#gtk - show div#cmnd
            $('.cmnd').click(function () {
                _gtk.hide(1500);
                _cmnd.show(1500);

                //add class active cho link được click
                $('.gtk').removeClass('active');
                $(this).addClass("active")
                return false;
            });

            //click vào link gtk show div#gtk - hidden div#cmnd
            $('.gtk').click(function () {
                _cmnd.hide(1500);
                _gtk.show(1500);

                //add class active cho link được click
                $('.cmnd').removeClass('active');
                $(this).addClass("active")
                return false;
            });
            $("#<%= btnSave.ClientID %>").click(function () {
                var check = 0;
                if ($("#cmndRegion").hasClass("active")) {
                    check = ktraCMND();
                }
                else {
                    check = ktraGTK();
                };

                if ((validateFormInputs('reg') == true) && (check == 1)) {
                    return true;

                } else {
                    return false;
                }

            });
            $(".Date").datepicker({ dateFormat: 'dd/mm/yy' });
            ////Disabled
            //$('.DivBussiness [type=text], .DivBussiness select ,.DivBussiness [type=radio],.DivBussiness textarea,.DivBussiness [type=checkbox]').each(function (e) {
            //    $(this).attr("disabled", "disabled");
            //});

            $("#<%=txtVonTienMat.ClientId %>").keyup(function (e) {
                // cho phep gõ số
                var _value = $(this).val().replace(/\./g, "");
                var abc = Formatcurrency(_value).replace(/,/g, ".");
                $(this).val(abc);

            });
            $("#<%=txtVonTaiSan.ClientId %>").keyup(function (e) {
                // cho phep gõ số
                var _value = $(this).val().replace(/\./g, "");
                var abc = Formatcurrency(_value).replace(/,/g, ".");
                $(this).val(abc);

            });
            $("#<%=txtBiz_InvestCapital.ClientId %>").keyup(function (e) {
                // cho phep gõ số
                var _value = $(this).val().replace(/\./g, "");
                var abc = Formatcurrency(_value).replace(/,/g, ".");
                $(this).val(abc);

                //convert so = chuoi
                var abc = docso($(this).val().replace(/\./g, ""));
                $("#<%=txtBiz_WordsMoney.ClientId %>").html(abc);
                $("#<%=txtMoney_string.ClientId %>").val($("#<%=txtBiz_WordsMoney.ClientId %>").html());

            });
            //Tỉnh hộ khẩu thường trú
            $("#<%= ddlTinhHoKhau.ClientID %>").change(function () {
                getProvince($(this).val(), $("#<%= ddlHuyenHoKhau.ClientID %>"));
            });
            //Huyện hộ khẩu thường trú
            $("#<%= ddlHuyenHoKhau.ClientID %>").change(function () {
                getProvince($(this).val(), $("#<%= ddlXaThiTranHoKhau.ClientID %>"));
                $("#<%= hidHuyenHoKhau.ClientID %>").val($(this).val());
            });
            //Xa thị trấn hộ khẩu thường trú
            $("#<%= ddlXaThiTranHoKhau.ClientID %>").change(function () {
                $("#<%= hidXaThiTranHoKhau.ClientID %>").val($(this).val());
            });

            //Tỉnh tạm trú
            $("#<%= ddlTinhHienTai.ClientID %>").change(function () {
                getProvince($(this).val(), $("#<%= ddlHuyenHienTai.ClientID %>"));
            });
            //Huyện tạm trú
            $("#<%= ddlHuyenHienTai.ClientID %>").change(function () {
                getProvince($(this).val(), $("#<%= ddlXaThiTranHienTai.ClientID %>"));
                $("#<%= hidHuyenHienTai.ClientID %>").val($(this).val());
            });
            //Xa thị trấn hộ khẩu thường trú
            $("#<%= ddlXaThiTranHienTai.ClientID %>").change(function () {
                $("#<%= hidXaThiTranHienTai.ClientID %>").val($(this).val());
            });

            //Tỉnh địa điểm kinh doanh
            $("#<%= ddlTinhDiaDiemKD.ClientID %>").change(function () {
                getProvince($(this).val(), $("#<%= ddlHuyenDiaDiemKD.ClientID %>"));
            });
            //Huyện địa điểm kinh doanh
            $("#<%= ddlHuyenDiaDiemKD.ClientID %>").change(function () {
                getProvince($(this).val(), $("#<%= ddlXaThiTranDiaDiemKD.ClientID %>"));
                $("#<%= hidHuyenDiaDiemKD.ClientID %>").val($(this).val());
            });
            //Xa thị trấn hộ khẩu thường trú
            $("#<%= ddlXaThiTranDiaDiemKD.ClientID %>").change(function () {
                $("#<%= hidXaThiTranDiaDiemKD.ClientID %>").val($(this).val());
            });

            // Get Detail Orderss
            var surl = '<%=ResolveUrl("~/Page/CertifiedHousehold.ashx")%>';
            var hidId = $("#<%= hidID.ClientID %>").val();
            surl += "?CertifiedID=" + hidId;
            $.ajax({
                url: surl,
                dataType: "json",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                dataFilter: function (data) {
                    return data;
                },
                success: function (data) {
                    if (data.CertifiedHouseholdNganhNghes.CertifiedHouseholdNganhNghe != null) {
                        if (data.CertifiedHouseholdNganhNghes.CertifiedHouseholdNganhNghe.length != null) {

                            //Chi tiet don hang co nhieu hon 1 item
                            if (data.CertifiedHouseholdNganhNghes.CertifiedHouseholdNganhNghe.length > 0) {
                                for (i = 0; i < data.CertifiedHouseholdNganhNghes.CertifiedHouseholdNganhNghe.length; i++) {
                                    $("#tableChoices").append(RowDetailOrder(i, data.CertifiedHouseholdNganhNghes.CertifiedHouseholdNganhNghe[i]));
                                    //nghiavt sau khi return str --> settype for nubmer va
                                    SetTypeforNumber(i);
                                    // ListenEnterOnForm();
                                }
                                $("#<%= hidRowIndex.ClientId %>").val(data.CertifiedHouseholdNganhNghes.CertifiedHouseholdNganhNghe.length);
                            }
                        }
                        else {
                            //Chi tiet don hang co 1 item           
                            var ctrlId = 0;
                            $("#tableChoices").append(RowDetailOrder(0, data.CertifiedHouseholdNganhNghes.CertifiedHouseholdNganhNghe));
                            SetTypeforNumber(ctrlId);
                            $("#<%= hidRowIndex.ClientId %>").val(1);
                        }
                        SetAutoComplete();
                        ListenEnterOnForm();
                    }
                    else {
                        $("#<%=hidSale_Unit.ClientId %>").val(2);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    Alertbox("Error")
                }
                //LANG NGHE ENTER
                //  ListenEnterOnForm();
            });
            //*******************************************************************
            //          TUANCD: START TO GET DETAIL CertifiedHouseHoldMember

            // Get detail CertifiedHouseholdMember
            $.ajax({
                url: '<%=ResolveUrl("~/Page/CertifiedHouseHoldMember.ashx")%>?CertifiedID=' + hidId,
                dataType: "json",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                dataFilter: function (data) {
                    return data;
                },
                success: function (data) {
                    if (data.CertifiedHouseholdMembers.CertifiedHouseholdMember != null) {
                        if (data.CertifiedHouseholdMembers.CertifiedHouseholdMember.length != null) {

                            //Chi tiet CertifiedHouseHoldMember co nhieu hon 1 item
                            if (data.CertifiedHouseholdMembers.CertifiedHouseholdMember.length > 0) {
                                for (i = 0; i < data.CertifiedHouseholdMembers.CertifiedHouseholdMember.length; i++) {
                                    $("#tableChoices1").append(rowDetailDSGV(i, data.CertifiedHouseholdMembers.CertifiedHouseholdMember[i]));
                                }
                                SetTypeforNumber();
                                $("#<%= hidRowIndex1.ClientID%>").val(data.CertifiedHouseholdMembers.CertifiedHouseholdMember.length);
                            }
                        }
                        else {
                            //Chi tiet CertifiedHouseHoldMember co 1 item           
                            var ctrlId = 0;
                            $("#tableChoices1").append(rowDetailDSGV(0, data.CertifiedHouseholdMembers.CertifiedHouseholdMember));
                            SetTypeforNumber();
                            $("#<%= hidRowIndex1.ClientID%>").val(1);
                        }
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    Alertbox("Error")
                }
                //LANG NGHE ENTER
                //  ListenEnterOnForm();
            });
            //***************************  END TUANCD *********************************
        });
    }
    //End function=======================================================//

    function showRowIndexs() {
        var i = 0;
        $("#tableChoices tr td.tdLabel").each(function () {
            i++;
            $(this).html(i + ".");
        });

    }

    function addFormField() {
        var ctrlId = $("#<%= hidRowIndex.ClientID %>").val();
        $("#tableChoices").append("<tr id='pRow" + ctrlId + "'><td width='20px' class='tdLabel'>" + (ctrlId * 10) + ".</td>" +
        "<td width='130px'><textarea rows='3' cols='10' class='TextBox' type='text' name='txtDescription" + ctrlId + "' id='txtDescription" + ctrlId + "' /></td>" +
        "<td width='130px'><input  class='TextBoxInPut' type='text'  name='txtChoice" + ctrlId + "' id='txtChoice" + ctrlId + "' style = 'width: 130px' onblur='SetOnBlurMaterial(" + ctrlId + ")' /></td>" +
        "<td><span id = 'spName" + ctrlId + "'></span></td><td style = 'display: none' nowrap ='nowrap' align = 'center'>&nbsp;&nbsp;<a id = 'hplSel" + ctrlId + "'  href = 'javascript:SelectCentifiedHouseholdNganhNghe(" + ctrlId + ")'>Chọn</a>&nbsp;-&nbsp;<a href='#' onClick='removeFormField(\"#pRow" + ctrlId + "\"); return false;'>Xóa</a><input type='text' name='hidAmount" + ctrlId + "' id='hidAmount" + ctrlId + "' value = '0' style = 'width: 1px; display: none' /></td></tr>");
        // CreateOption(ctrlId);
        // SetTypeforNumber(ctrlId);
        $("#<%= hidRowIndex.ClientID %>").val(++ctrlId);

        showRowIndexs();

        SetAutoComplete();

        $("#<%= divChoices.ClientID %> #tableChoices input").focus(function () {
            $("#curId").val(this.id);
        });
    }

    // Xet chi cho go cac phim so tren ban phim
    function SetTypeforNumber(sIndex) {
        $("#txtAmount" + sIndex).keydown(function (event) {
            // Allow: backspace, delete, tab and escape
            if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 ||
                // Allow: Ctrl+A
            (event.keyCode == 65 && event.ctrlKey === true) ||
                // Allow: home, end, left, right
            (event.keyCode >= 35 && event.keyCode <= 39)) {
                // let it happen, don't do anything
                return;
            }
            else {
                // Ensure that it is a number and stop the keypress
                if ((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                    event.preventDefault();
                }
            }
        });
    }

    function removeFormField(id) {

        var indexRow = eval(id.substring(5, id.length));
        var cId = $("input:hidden", id).val();
        var data = "{'cID':'" + cId + "'}"; //create the JSON data to send to server
        if (cId > 0) //call the Page method using JQuery ajax 
        {
            $.ajax(
            {
                type: "POST",
                url: "Edit.aspx/DeletePollChoice",
                data: data,
                contentType: "application/json; charset=utf-8",
                dataType: "json"
            });
        }
        $(id).remove();
        var index = $("#<%=hidRowIndex.ClientId %>");

        // Nếu dòng chọn xóa  nằm trc dòng cuối cùng
        if (indexRow + 1 < index.val()) {
            for (i = indexRow + 1; i < index.val() ; i++) {
                // Lấy index dòng mới
                var ctrlId = i - 1;
                // Nếu là dòng đã có dự liệu thì giữ lấy lai giá tri cũ trc khi xóa
                if ($("#txtChoice" + i).val() != "" || $("#txtDescription" + i).val() != "") {

                    //  var promotion = $("#Promotion" + i).val();
                    var materialCode = $("#txtChoice" + i).val();
                    var materialName = $("#spName" + i).text();
                    var amount = $("#txtDescription" + i).val();
                    //  var PcsOnCTN = $("#spQuyDoi" + i).html();
                    var sAmount = $("#spGrossAmount" + i).text();
                    var hidGrossAmount = $("#hidAmount" + i).val();


                    // xóa dòng cũ
                    $("#pRow" + i).remove();

                    $("#tableChoices").append("<tr id='pRow" + ctrlId + "'><td width='20px' class='tdLabel'>" + (ctrlId) + ".</td><td><textarea rows='3' cols='10' class='TextBoxInPut' type='text' name='txtDescription" + ctrlId + "' id='txtDescription" + ctrlId + "' value='" + materialCode + "' /></td><td width='130px'><input class='TextBoxInPut' type='text' name='txtChoice" + ctrlId + "' id='txtChoice" + ctrlId + "' style = 'width: 130px' onblur='SetOnBlurMaterial(" + ctrlId + ")' value='" + materialCode + "' /></td><td><span id = 'spName" + ctrlId + "'>" + materialName + "</span></td><td nowrap ='nowrap' align = 'center'>&nbsp;&nbsp;<a id = 'hplSel" + ctrlId + "'  href = 'javascript:SelectCentifiedHouseholdNganhNghe(" + ctrlId + ")'>Chọn</a>&nbsp;-&nbsp;<a href='#' onClick='removeFormField(\"#pRow" + ctrlId + "\"); return false;'>Xóa</a><input type='text' name='hidAmount" + ctrlId + "' id='hidAmount" + ctrlId + "' value = '0' style = 'width: 1px; display: none' /></td></tr>");


                    SetTypeforNumber(ctrlId);
                }
                else {
                    $("#pRow" + i).remove();

                    $("#tableChoices").append("<tr id='pRow" + ctrlId + "'><td width='20px' class='tdLabel'>" + (ctrlId) + ".</td><td ><textarea rows='3' clos='10'  class='TextBoxInPut' type='text' name='txtDescription" + ctrlId + "' id='txtDescription" + ctrlId + "' /></td><td ><input  class='TextBoxInPut' type='text' name='txtChoice" + ctrlId + "' id='txtChoice" + ctrlId + "' style = 'width: 130px' onblur='SetOnBlurMaterial(" + ctrlId + ")' /></td><td><span id = 'spName" + ctrlId + "'></span></td><td nowrap ='nowrap' align = 'center'>&nbsp;&nbsp;<a id = 'hplSel" + ctrlId + "'  href = 'javascript:SelectCentifiedHouseholdNganhNghe(" + ctrlId + ")'>Chọn</a>&nbsp;-&nbsp;<a href='#' onClick='removeFormField(\"#pRow" + ctrlId + "\"); return false;'>Xóa</a><input type='text' name='hidAmount" + ctrlId + "' id='hidAmount" + ctrlId + "' value = '0' style = 'width: 1px; display: none' /></td></tr>");


                    // CreateOption(ctrlId);

                    SetTypeforNumber(ctrlId);
                }
            }
            SetAutoComplete();
        }

        //ga'n lai index khi remove
        index.val(index.val() - 1);

        showRowIndexs();
        //GetTotalGrossAmount();
    }

    function CheckValuePress(id) {
        alert($("#txtAmount" + sIndex).val());


        if ($("#txtAmount" + sIndex).val() = 0) {
            Alertbox("Hãy nhập số lượng");

        }

    }

    function SetAutoComplete() {
        $(".TextBoxInPut").autocomplete({
            source: function (request, response) {
                $.ajax({
                    url: '<%=ResolveUrl("~/Services/wsAutoComplete.asmx/GetListAutoCompleteNganhNghe")%>',
                    data: "{ 'strSrc': '" + request.term.trim() + "' }",
                    dataType: "json",
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    dataFilter: function (data) {
                        return data;
                    },
                    success: function (data) {
                        response($.map(data.d, function (item) {
                            $("#<%=txtmaterialCode.ClientId %>").val('');
                            return {
                                value: item
                            }
                        }))
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        //Alertbox(textStatus);
                    }
                });
            },
            minLength: 1
        });

            $('input').live("keypress", function (e) {
                /* ENTER PRESSED*/
                if (e.keyCode == 13) {
                    /* FOCUS ELEMENT */
                    var inputs = $(this).parents("form").eq(0).find(":input");
                    var idx = inputs.index(this);

                    //hard code for edit
                    if ((idx - 25) % 3 == 1) {
                        inputs[idx + 2].focus();
                        inputs[idx + 2].select();
                    } else {

                        inputs[idx + 1].focus(); //  handles submit buttons
                        inputs[idx + 1].select();
                    }
                    return false;
                }
            });

        }
        //Set lai gia tri khi nguoi dung chon san pham bang chuc nang AutoComplete
        function SetOnBlurMaterial(sIndexName) {
            var sMaterialName = $("#txtChoice" + sIndexName).val();
            if (sMaterialName != "") {
                if (sMaterialName.indexOf(" - ") != -1) {
                    var arrMaterial = sMaterialName.split(" - ");
                    $("#spName" + sIndexName).html(arrMaterial[1]);
                    $("#txtChoice" + sIndexName).val(arrMaterial[0]);
                }
                else
                    $("#txtChoice" + sIndexName).val(sMaterialName.substring(0, 6));

                //                $("#txtAmount" + sIndexName).select();
                //  GetAmountItem(sMaterialName.substring(0, 6), $("#txtAmount" + sIndexName).val(), $("#ddlUnit" + sIndexName).val(), sIndexName);
            }

        }

        function SelectCentifiedHouseholdNganhNghe(item) {
            $("#<%=hplShowCertifiedHouseholdNganhNghe.ClientId %>").attr("href", "../../FrontEnd/Page/Member/Popup.aspx?item=" + item + "&keepThis=true&TB_iframe=true&height=420&width=500&modal=true");
            $("#<%=hplShowCertifiedHouseholdNganhNghe.ClientId %>").click();
        }

        function setProductValue(MaterialCode, MaterialName, item) {
            $("#txtChoice" + item).val(MaterialCode);
            $("#spName" + item).html(MaterialName);
            // GetAmountItem(MaterialCode, $("#txtAmount" + item).val(), $("#ddlUnit" + item).val(), item);
        }


        //show chi tiết ngành nghề
        function RowDetailOrder(ctrlId, objDetail) {
            var str = "<tr id='pRow" + ctrlId + "'>\
        <td width='20px' class='tdLabel'>" + (ctrlId + 1) + ".</td><td>\
        <textarea rows='3' cols='10' class='TextBox' type='text' name='txtDescription" + ctrlId + "' id='txtDescription" + ctrlId + "' value='" + objDetail.Description + "'>" + objDetail.Description + "</textarea>\
        </td><td>\
        <input class='TextBoxInPut' type='text' name='txtChoice" + ctrlId + "' id='txtChoice" + ctrlId + "' style = 'width: 130px' onblur='SetOnBlurMaterial(" + ctrlId + ")' value='" + objDetail.Code + "' />\
        </td><td width='130px'>\
        <span id = 'spName" + ctrlId + "'>" + objDetail.Name + "</span>\</td><td style = 'display: none' nowrap ='nowrap' align = 'Center'>&nbsp;&nbsp;<a id = 'hplSel" + ctrlId + "'  href = 'javascript:SelectCentifiedHouseholdNganhNghe(" + ctrlId + ")'>Chọn</a>&nbsp;-&nbsp;<a href='#' onClick='removeFormField(\"#pRow" + ctrlId + "\"); return false;'>Xóa</a><input type='text' name='hidAmount" + ctrlId + "' id='hidAmount" + ctrlId + "' value = '0' style = 'width: 1px; display: none' />\
        </td></tr>";
            return str;
        }

        function getProvince(ProvinceId, ddlEffect) {

            $.ajax({
                url: '<%=ResolveUrl("~/Services/wsAutoComplete.asmx/getProvince")%>',
                data: "{'ProvinceId': '" + ProvinceId + "'}",
                dataType: "json",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                success: function (data) {
                    json = eval("(" + data.d + ")");
                    $(function () {
                        ddlEffect.find('option').remove().end().append('<option value="">--- Chọn --- </option>');
                        for (i = 0; i < json.length; i++) {
                            var _Text = json[i]["Title"];
                            var _Value = json[i]["Id"];
                            ddlEffect.append('<option value=' + _Value + '>' + _Text + '</option>');
                        }
                        return false;
                    });

                }, //ham thuc thi neu thanh cong    
                error: function () {
                    alert("Có lỗi xảy ra. Vui lòng kiểm tra đường truyền");
                } //ham thuc thi neu loi xay ra.
            });
            return false;

        }
        //****************************************************************************
        //  TUANCD: 2014/11/1: Thêm các script check các phần địa chỉ thường trú
        //  
        //****************************************************************************/

        function CoppyHTML(isCoppy) {
            if (isCoppy) {
                $("#<% =txtDiaChiHienTai.ClientID%>").val($("#<% =txtDiaChiHoKhau.ClientID%>").val());
            $("#<% =ddlTinhHienTai.ClientID%>").html($("#<% =ddlTinhHoKhau.ClientID%>").html());
            $("#<% =ddlHuyenHienTai.ClientID%>").html($("#<% =ddlHuyenHoKhau.ClientID%>").html());
            $("#<% =ddlXaThiTranHienTai.ClientID%>").html($("#<% =ddlXaThiTranHoKhau.ClientID%>").html());
            // set lại value cho các select 
            $("#<% =ddlTinhHienTai.ClientID%>").val($("#<% =ddlTinhHoKhau.ClientID%>").val());
            $("#<% =ddlHuyenHienTai.ClientID%>").val($("#<% =ddlHuyenHoKhau.ClientID%>").val());
            $("#<% =ddlXaThiTranHienTai.ClientID%>").val($("#<% =ddlXaThiTranHoKhau.ClientID%>").val());

            // Luu vào hidden field để lưu           
            $("#<% =hidHuyenHienTai.ClientID%>").val($("#<% =hidHuyenHoKhau.ClientID%>").val());
            $("#<% =hidXaThiTranHienTai.ClientID%>").val($("#<% =hidXaThiTranHoKhau.ClientID%>").val());

        } else {
            $("#<% =txtDiaChiHienTai.ClientID%>").val('');
            $("#<% =ddlTinhHienTai.ClientID%>").val('');
            $("#<% =ddlHuyenHienTai.ClientID%>").html('');
            $("#<% =ddlXaThiTranHienTai.ClientID%>").html('');
            // reset lai hidden field     
            $("#<% =hidHuyenHienTai.ClientID%>").val('');
            $("#<% =hidXaThiTranHienTai.ClientID%>").val('');

        }
        return false;
    }

    // Thêm 1 dòng danh sách góp vốn
    function addFormFieldDSGV() {
        var ctrlId = $("#<%= hidRowIndex1.ClientID%>").val();

        $("#tableChoices1").append(
            "<tr id='pRow__" + ctrlId + "'>" +
               " <td width='20px' class='tdLabel'></td>" +
               " <td width='118px'>" +
               "     <input class='TextBox' type='text' name='txtTenTV__" + ctrlId + "' id='txtTenTV__" + ctrlId + "' style = 'width: 95px !important'/>" +
               "</td>" +
               " <td width='118px'>" +
               "     <textarea rows='3' cols='10' width='95px' class='TextBox' type='text' name='txtNoiDKHK__" + ctrlId + "' id='txtNoiDKHK__" + ctrlId + "' style = 'width: 95px !important' />" +
               " </td>" +
               " <td width='118px'>" +
               "     <input  class='TextBox TextBoxNumberInPut' type='text' name='txtVonGop__" + ctrlId + "' id='txtVonGop__" + ctrlId + "' style = 'width: 95px !important'/>" +
               "</td>" +
               " <td width='118px'>" +
               "    <input  class='TextBox TextBoxNumberInPut' type='text' name='txtTyLeVonGop__" + ctrlId + "' id='txtTyLeVonGop__" + ctrlId + "' style = 'width: 95px !important'/>" +
               " </td>" +
               " <td width='118px'>" +
               "     <input  class='TextBox' type='text' name='txtCMND__" + ctrlId + "' id='txtCMND__" + ctrlId + "' style = 'width: 95px !important'/>" +
               " </td>" +
               " <td width='118px'>" +
               "     <textarea rows='3' cols='10' width='95px' class='TextBox' type='text' name='txtDescription__" + ctrlId + "' id='txtDescription" + ctrlId + "' style = 'width: 95px !important' />" +
               " </td>" +
               " <td  nowrap ='nowrap' align = 'center' width='20px'>&nbsp;&nbsp;" +
               "     <a  href='javascript:void(0)' onClick='removeFormFieldDSGV(\"" + ctrlId + "\"); return false;'>Xóa</a>" +
               "  </td>" +
            "</tr>");
        $("#<%= hidRowIndex1.ClientID%>").val(++ctrlId);

        SetTypeforNumber();
        $("#<%= divChoices.ClientID %> #tableChoices1 input").focus(function () {
            $("#curId1").val(this.id);
        });
    }

    function removeFormFieldDSGV(index) {
        try {
            $("#pRow__" + index).remove();
            // Duyệt trên tất cả các row change lại id của 
            var _row = 0;
            $.each($("#tableChoices1 tr").not('.GridHeader'), function (idx, obj) {
                if (index <= idx) {
                    var _oldIdtr = $(this).attr('id');
                    var _newIdtr = _oldIdtr.substring(0, _oldIdtr.indexOf("__")) + "__" + idx;
                    $(this).attr('id', _newIdtr);
                    $(this).find("td.tdLabel").html(idx + ".");
                    // Lấy ra các input và textarea để change id 
                    try {
                        // Change name and id of input,textarea telement
                        $.each($(this).find("input,textarea"), function (idx1, obj1) {
                            var _oldId = $(this).attr('id');
                            var _newId = _oldId.substring(0, _oldId.indexOf("__")) + "__" + idx;
                            $(this).attr('id', _newId).attr('name', _newId);
                        });
                        // change function of a
                        $.each($(this).find("a"), function (idx1, obj1) {
                            var _td = $(this).parent("td");
                            $(this).remove();
                            _td.append("<a href='javascript:void(0)' onClick='removeFormFieldDSGV(\"" + idx + "\"); return false;'>Xóa</a>");
                        });

                    } catch (e) {
                    }

                }
                _row = idx
            });
        } catch (e) {

        }

        //showRowIndexsDSGV();
        $("#<%= hidRowIndex1.ClientID%>").val(_row++);
    }

    // Xet chi cho go cac phim so tren ban phim
    function SetTypeforNumber() {
        $(".TextBoxNumberInPut").keydown(function (event) {
            // Allow: backspace, delete, tab and escape
            if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 ||
                // Allow: Ctrl+A
            (event.keyCode == 65 && event.ctrlKey === true) ||
                // Allow: home, end, left, right
            (event.keyCode >= 35 && event.keyCode <= 39)) {
                // let it happen, don't do anything
                return;
            }
            else {
                // Ensure that it is a number and stop the keypress
                if ((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                    event.preventDefault();
                }
            }
        });
    }
    function rowDetailDSGV(ctrlId, objDetail) {
        var _str = "<tr id='pRow__" + ctrlId + "'>" +
               " <td width='20px' class='tdLabel'>" + (ctrlId * 1 + 1) + ". </td>" +
               " <td width='118px'>" +
               "     <input class='TextBox' type='text' name='txtTenTV__" + ctrlId + "' id='txtTenTV__" + ctrlId + "' style = 'width: 95px !important' value=' " + objDetail.TenTV + "'/>" +
               "</td>" +
               " <td width='118px'>" +
               "     <textarea rows='3' cols='10' width='95px' class='TextBox' type='text' name='txtNoiDKHK__" + ctrlId + "' id='txtNoiDKHK__" + ctrlId + "' style = 'width: 95px !important'>" + objDetail.NoiDK + "</textarea>" +
               " </td>" +
               " <td width='118px'>" +
               "     <input  class='TextBox TextBoxNumberInPut' type='text' name='txtVonGop__" + ctrlId + "' id='txtVonGop__" + ctrlId + "' style = 'width: 95px !important' value=' " + objDetail.VonGop + "'/>" +
               "</td>" +
               " <td width='118px'>" +
               "    <input  class='TextBox TextBoxNumberInPut' type='text' name='txtTyLeVonGop__" + ctrlId + "' id='txtTyLeVonGop__" + ctrlId + "' style = 'width: 95px !important' value=' " + objDetail.TyLeVonGop + "'/>" +
               " </td>" +
               " <td width='118px'>" +
               "     <input  class='TextBox' type='text' name='txtCMND__" + ctrlId + "' id='txtCMND__" + ctrlId + "' style = 'width: 95px !important' value=' " + objDetail.CMND + "'/>" +
               " </td>" +
               " <td width='118px'>" +
               "     <textarea rows='3' cols='10' width='95px' class='TextBox' type='text' name='txtDescription__" + ctrlId + "' id='txtDescription" + ctrlId + "' style = 'width: 95px !important'>" + objDetail.GhiChu + "</textarea>" +
               " </td>" +
               " <td style = 'display: none' nowrap ='nowrap' align = 'center' width='20px'>&nbsp;&nbsp;" +
               "     <a href='javascript:void(0)' onClick='removeFormFieldDSGV(\"" + ctrlId + "\"); return false;'>Xóa</a>" +
               "  </td>" +
            "</tr>"
        return _str;

    }

    // để thực hiện show phân CMND or Giấy tờ khác
    function ShowCMND(isCMND) {// 1: là CMND, ngược lại là 0
        if (isCMND * 1 == 1) {
            $('.gtk').removeClass('active');
            setTimeout(function () {
                $('.cmnd').removeClass('active').addClass("active").click();
            }, 1000);
        }
        else {
            $('.cmnd').removeClass('active');
            setTimeout(function () {
                $('.gtk').removeClass('active').addClass("active").click();
            }, 500);
        }
    }

    //von
    function getTotalCapital() {
        var intTotal = 0;
        if ($("#<%= txtVonTienMat.ClientID  %>").val() != "") {
            intTotal += parseInt($("#<%= txtVonTienMat.ClientID  %>").val().replace(/\./g, ''));
        };
        if ($("#<%= txtVonTaiSan.ClientID  %>").val() != "") {
            intTotal += parseInt($("#<%= txtVonTaiSan.ClientID  %>").val().replace(/\./g, ''));
        };

        $("#<%= txtBiz_InvestCapital.ClientID  %>").val(Formatcurrency(intTotal).replace(/,/g, "."));

        var abc = docso(intTotal);
        $("#<%=txtBiz_WordsMoney.ClientId %>").html(String(abc));
        $("#<%=txtMoney_string.ClientId %>").val($("#<%=txtBiz_WordsMoney.ClientId %>").html());




    }

</script>
<asp:UpdatePanel ID="uplHoSoHoKinhDoanh" runat="server">
    <ContentTemplate>
        <div class="content_porletform">
            <div class="HeadTitle">
                <h3 class="text-center">HỒ SƠ HỘ KINH DOANH
                </h3>
            </div>
            <div class="link_expand" style="font-style: italic;">
                <a href="" class="Detail active" id="B1">Xem chi tiết</a>&nbsp;|&nbsp;<a href=""
                    class="ViewList" id="B2">Xem các thành phần hồ sơ</a>
            </div>
            <div id="ViewList" style="display: none;">
                <%--thong tin chung--%>
                <div class="box_contentform">
                    <div class="box_scroll_grid">
                        <%--thong tin chung--%>
                        <div class="panel-group margin-detail">
                            <div class="panel-body">
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label10" CssClass="TextLabel" runat="server" Text="Tên hộ kinh doanh: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:Label ID="lblBizName" CssClass="TextLabel fontuppercase" runat="server" />
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label CssClass="TextLabel" runat="server" Text="Số GCN: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:Label ID="lblCertifiedCode" CssClass="TextLabel" runat="server" />
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label1" CssClass="TextLabel" runat="server" Text="Địa điểm kinh doanh: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:Label ID="lblBiz_HeadOffice" CssClass="TextLabel" runat="server" />
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label2" CssClass="TextLabel" runat="server" Text="Điện thoại: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:Label ID="lblOw_Tel" CssClass="TextLabel" runat="server" />
                                    </div>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label21" CssClass="TextLabel" runat="server" Text="Người đại diện: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:Label ID="lblOwRepresentative" CssClass="TextLabel fontuppercase" runat="server" />
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label22" CssClass="TextLabel" runat="server" Text="Số CMND: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:Label ID="lblOwCardId" CssClass="TextLabel" runat="server" />
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label23" CssClass="TextLabel" runat="server" Text="Ngày cấp: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:Label ID="lblOwCardDate" CssClass="TextLabel" runat="server" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div style="display: none">
                        <asp:HiddenField ID="HiddenField1" Value="0" runat="server" />
                    </div>
                </div>
            </div>
            <div id="Detail">
                <div class="box_contentform">
                    <div class="box_scroll_grid">
                        <div class="DivRow" id="DivChanging" runat="server">
                            <div class="DivLabel">
                                Loại thay đổi:
                            </div>
                            <div class="DivTextBox">
                                <asp:GridView ID="grdShowLoaiThayDoi" runat="server" AutoGenerateColumns="False"
                                    EmptyDataText="{Không có dữ liệu}" AllowPaging="false" Width='50%' BorderWidth="1px"
                                    CssClass="GridBorder">
                                    <Columns>
                                        <asp:TemplateField>
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkItem" runat="server" />
                                            </ItemTemplate>
                                            <ItemStyle Width="15%" HorizontalAlign="Center" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="STT">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblSTT" Text=''></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle Width="15%" HorizontalAlign="Left" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField='Name' HeaderText='Loại thay đổi'>
                                            <ItemStyle Width='70%' />
                                        </asp:BoundField>
                                    </Columns>
                                    <HeaderStyle Height="26px" HorizontalAlign="Left" CssClass="GridHeader" />
                                    <RowStyle CssClass="GridRow" Height="23px" />
                                    <AlternatingRowStyle CssClass="GridAlterRow" />
                                    <PagerStyle CssClass="GridPaged" HorizontalAlign="Right" Height="23px" />
                                    <PagerSettings Mode="Numeric" PageButtonCount="2" />
                                    <EmptyDataRowStyle CssClass="GridTextEmpty" HorizontalAlign="Center" />
                                </asp:GridView>
                            </div>
                        </div>
                        <div class="panel-group">
                            <div class="panel-body">
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label11" CssClass="TextLabel" runat="server" Text="Số GCN: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:TextBox ID="txtSoGCN" CssClass="TextBox" runat="server" Text="" />
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label12" CssClass="TextLabel" runat="server" Text="Ngày cấp GCN: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:TextBox ID="txtNgayCapGCN" CssClass="TextBox" runat="server" Text="" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <%--thong tin chung--%>
                        <div class="panel-group">
                            <div class="panel-body">
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label3" CssClass="TextLabel" runat="server" Text="Tên hộ kinh doanh: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc1:ValidationTextBox ID="txtBizName" CssClass="TextBox TextBoxLong" Group="reg"
                                            AssociatedLableText="Tên hộ kinh doanh." runat="server" Text="" MaxLength="250"
                                            DataType="required"></cc1:ValidationTextBox>&nbsp;<span style="color: red">*</span>
                                        <asp:Button ID="btnCheckTenHo" runat="server" Text=" Kiểm tra " CssClass="btn btn-info"
                                            CausesValidation="false" Style="display: none;" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="panel-group">
                            <div class="panel-heading">
                                <%--start .panel-heading thong tin ho kinh doanh --%>
                                <img src='<%=ResolveUrl("~/images/arrow-down.png")%>' border="0" align="absmiddle">
                                Thông tin hộ kinh doanh
                            </div>
                            <div class="panel-body">
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label4" CssClass="TextLabel" runat="server" Text="Họ tên đại diên kinh doanh: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc1:ValidationTextBox ID="txtOwRepresentative" CssClass="TextBox" Group="reg" AssociatedLableText="Họ tên đại diên kinh doanh."
                                            runat="server" Text="" MaxLength="50" DataType="required"></cc1:ValidationTextBox>&nbsp;<span
                                                style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLeft">
                                        <div class="DivLabel">
                                            <asp:Label ID="Label24" CssClass="TextLabel" runat="server" Text="Giới tính: " />
                                        </div>
                                        <div class="DivTextBox text_inputright">
                                            <asp:RadioButtonList ID="rdlSex" runat="server" RepeatDirection="Horizontal">
                                                <asp:ListItem Value="1" Text="Nam" Selected="True" />
                                                <asp:ListItem Value="0" Text="Nữ" />
                                            </asp:RadioButtonList>
                                        </div>
                                    </div>
                                    <div class="DivRight">
                                        <div class="DivLabel">
                                            <asp:Label ID="Label26" CssClass="TextLabel" runat="server" Text="Ngày sinh: " />
                                        </div>
                                        <div class="DivTextBox">
                                            <cc1:ValidationTextBox ID="txtOwDateOfBirth" CssClass="TextBox Date" Group="reg"
                                                AssociatedLableText="Ngày sinh." runat="server" Text="" MaxLength="50" DataType="required"></cc1:ValidationTextBox>&nbsp;<span
                                                    style="color: red">*</span>
                                        </div>
                                    </div>
                                    <div style="clear: both;">
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLeft">
                                        <div class="DivLabel">
                                            <asp:Label ID="Label27" CssClass="TextLabel" runat="server" Text="Dân tộc: " />
                                        </div>
                                        <div class="DivTextBox">
                                            <cc2:ValidationDropdownlist ID="ddlCitizen" Group="reg" AssociatedLableText="Dân tộc"
                                                CssClass="DropDownList" runat="server" DataType="required">
                                            </cc2:ValidationDropdownlist>
                                            &nbsp;<span style="color: red">*</span>
                                        </div>
                                    </div>
                                    <div class="DivRight">
                                        <div class="DivLabel">
                                            <asp:Label ID="Label28" CssClass="TextLabel" runat="server" Text="Quốc tịch: " />
                                        </div>
                                        <div class="DivTextBox">
                                            <cc2:ValidationDropdownlist ID="ddlCountry" Group="reg" AssociatedLableText="Quốc tịch"
                                                CssClass="DropDownList" runat="server" DataType="required">
                                            </cc2:ValidationDropdownlist>
                                            &nbsp;<span style="color: red">*</span>
                                        </div>
                                    </div>
                                    <div style="clear: both;">
                                    </div>
                                </div>
                                <div class="link_expand">
                                    <a href="" class="cmnd active" id="cmndRegion">CMND</a>&nbsp;|&nbsp;<a href="" class="gtk"
                                        id="gtkRegion">Giấy tờ khác</a>
                                </div>
                                <div id="cmnd">
                                    <div class="DivRow">
                                        <div class="DivLabel">
                                            <asp:Label ID="Label5" CssClass="TextLabel" runat="server" Text="Số CMND: " />
                                        </div>
                                        <div class="DivTextBox">
                                            <cc1:ValidationTextBox ID="txtOwCardId" CssClass="TextBox " Group="reg" AssociatedLableText="Số CMND."
                                                runat="server" Text="" MaxLength="12" CustomPattern="CMND"></cc1:ValidationTextBox>&nbsp;<span
                                                    style="color: red">*</span>
                                            <asp:Button ID="btnCheckCMND" runat="server" Text=" Kiểm tra " CssClass="btn btn-info"
                                                CausesValidation="false" Style="display: none;" />
                                        </div>
                                        <div class="DivLabel">
                                            <asp:Label ID="Label6" CssClass="TextLabel" runat="server" Text="Ngày cấp: " />
                                        </div>
                                        <div class="DivTextBox">
                                            <cc1:ValidationTextBox ID="txtOwCardDate" CssClass="TextBox Date" Group="reg" AssociatedLableText="Ngày cấp."
                                                runat="server" Text="" MaxLength="50"></cc1:ValidationTextBox>&nbsp;<span style="color: red">*</span>
                                        </div>
                                    </div>
                                    <div class="DivRow">
                                        <div class="DivLabel">
                                            <asp:Label ID="Label25" CssClass="TextLabel" runat="server" Text="Nơi cấp: " />
                                        </div>
                                        <div class="DivTextBox">
                                            <cc2:ValidationDropdownlist ID="ddlDeptCertified" Group="reg" AssociatedLableText="Nơi cấp"
                                                CssClass="DropDownList" runat="server">
                                            </cc2:ValidationDropdownlist>
                                            &nbsp;<span style="color: red">*</span>
                                        </div>
                                    </div>
                                </div>
                                <div id="gtk" style="display: none;">
                                    <div class="DivRow">
                                        <div class="DivLabel">
                                            <asp:Label ID="Label7" Text="Giấy tờ CTCN(không có CMND): " CssClass="TextLabel"
                                                runat="server" />
                                        </div>
                                        <div class="DivTextBox">
                                            <cc2:ValidationDropdownlist ID="ddlOthersPaper" Group="reg" AssociatedLableText="Giấy tờ CTCN(không có CMND)"
                                                CssClass="DropDownList" runat="server">
                                            </cc2:ValidationDropdownlist>
                                            &nbsp;<span style="color: red">*</span>
                                        </div>
                                    </div>
                                    <div class="DivRow">
                                        <div class="DivLabel">
                                            <asp:Label ID="Label29" CssClass="TextLabel" runat="server" Text="Số CTCN: " />
                                        </div>
                                        <div class="DivTextBox">
                                            <cc1:ValidationTextBox ID="txtOtherPaperCode" CssClass="TextBox " Group="reg" AssociatedLableText="Số CTCN."
                                                runat="server" Text="" MaxLength="50"></cc1:ValidationTextBox>&nbsp;<span style="color: red">*</span>
                                        </div>
                                        <div class="DivLabel">
                                            <asp:Label ID="Label30" CssClass="TextLabel" runat="server" Text="Ngày cấp: " />
                                        </div>
                                        <div class="DivTextBox">
                                            <cc1:ValidationTextBox ID="txtOthersPaperDateIssue" CssClass="TextBox Date" Group="reg"
                                                AssociatedLableText="Ngày cấp." runat="server" Text="" MaxLength="50"></cc1:ValidationTextBox>&nbsp;<span
                                                    style="color: red">*</span>
                                        </div>
                                    </div>
                                    <div class="DivRow">
                                        <div class="DivLabel">
                                            <asp:Label ID="Label31" CssClass="TextLabel" runat="server" Text="Nơi cấp: " />
                                        </div>
                                        <div class="DivTextBox">
                                            <cc2:ValidationDropdownlist ID="ddlOthersPaper_NoiCap" Group="reg" AssociatedLableText="Nơi cấp"
                                                CssClass="DropDownList" runat="server">
                                            </cc2:ValidationDropdownlist>
                                            &nbsp;<span style="color: red">*</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row_subtitle">
                                    <div class="texttitle_sub">
                                        Hộ khẩu thường trú
                                    </div>
                                    <div class="icon_arrow_sub">
                                        &nbsp;
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="lblAddressThuongTruTitle" CssClass="TextLabel" Text="Địa chỉ:" runat="server" />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc1:ValidationTextBox ID="lblAddressThuongTru" CssClass="TextBox" Group="reg"
                                            AssociatedLableText="." runat="server" Text="" MaxLength="50" Width="450px"></cc1:ValidationTextBox>
                                    </div>
                                </div>
                                <div class="DivRow hidden">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label35" CssClass="TextLabel" Text="Tỉnh/Thành phố:" runat="server" />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc2:ValidationDropdownlist ID="ddlTinhHoKhau" Group="reg" AssociatedLableText="Tỉnh"
                                            CssClass="DropDownList" runat="server" DataType="required">
                                        </cc2:ValidationDropdownlist>
                                        &nbsp;<span style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="DivRow hidden">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label34" CssClass="TextLabel" Text="Quận/Huyện/Thị xã/Thành phố thuộc tỉnh:"
                                            runat="server" />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc2:ValidationDropdownlist ID="ddlHuyenHoKhau" Group="reg" AssociatedLableText="Huyện"
                                            CssClass="DropDownList" runat="server" DataType="required">
                                        </cc2:ValidationDropdownlist>
                                        &nbsp;<span style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="DivRow hidden">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label33" CssClass="TextLabel" Text="Xã/Phường/Thị trấn:" runat="server" />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc2:ValidationDropdownlist ID="ddlXaThiTranHoKhau" Group="reg" AssociatedLableText="Xã thị trấn"
                                            CssClass="DropDownList" runat="server" DataType="required">
                                        </cc2:ValidationDropdownlist>
                                        &nbsp;<span style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="DivRow hidden">
                                    <div class="DivLabel">
                                        <asp:Label ID="lblDC1" CssClass="TextLabel" Text="Số nhà, đường phố/xóm/ấp/thôn:"
                                            runat="server" />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc1:ValidationTextBox ID="txtDiaChiHoKhau" CssClass="TextBox" Group="reg" AssociatedLableText="Địa chỉ."
                                            runat="server" Text="" MaxLength="50" DataType="required"></cc1:ValidationTextBox>&nbsp;<span
                                                style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="row_subtitle">
                                    <div class="texttitle_sub">
                                        Chỗ ở hiện tại &nbsp;&nbsp;&nbsp;
                                       <%-- <!-- Tuancd: 2014/11/1: Thêm 2 checkbox copy selection địa chỉ thường trú-->
                                        <input type="radio" id="chkSame" name="chkAddress" onclick="CoppyHTML(true);" style="cursor: pointer" /><label
                                            for="chkSame">
                                            &nbsp;Như trên |
                                        </label>
                                        <input type="radio" id="chkOther" name="chkAddress" checked="checked" onclick="CoppyHTML(false);"
                                            style="cursor: pointer" /><label for="chkOther">
                                                &nbsp;Khác</label>
                                        <!-- End Tuancd-->--%>
                                    </div>
                                    <div class="icon_arrow_sub">
                                        &nbsp;
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="lblAddressTamTruTitle" CssClass="TextLabel" Text="Địa chỉ:" runat="server" />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc1:ValidationTextBox ID="lblAddressTamTru" CssClass="TextBox" Group="reg"
                                            AssociatedLableText="." runat="server" Text="" MaxLength="50" Width="450px"></cc1:ValidationTextBox>
                                    </div>
                                </div>
                                <div class="DivRow hidden">
                                    <div class="DivLabel">
                                        <asp:Label ID="lblTinh2" CssClass="TextLabel" Text="Tỉnh/Thành phố:" runat="server" />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc2:ValidationDropdownlist ID="ddlTinhHienTai" Group="reg" AssociatedLableText="Tỉnh"
                                            CssClass="DropDownList" runat="server" DataType="required">
                                        </cc2:ValidationDropdownlist>
                                        &nbsp;<span style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="DivRow hidden">
                                    <div class="DivLabel">
                                        <asp:Label ID="lblHuyen2" CssClass="TextLabel" Text="Quận/Huyện/Thị xã/Thành phố thuộc tỉnh:"
                                            runat="server" />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc2:ValidationDropdownlist ID="ddlHuyenHienTai" Group="reg" AssociatedLableText="Huyện"
                                            CssClass="DropDownList" runat="server" DataType="required">
                                        </cc2:ValidationDropdownlist>
                                        &nbsp;<span style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="DivRow hidden">
                                    <div class="DivLabel">
                                        <asp:Label ID="lblXaThiTran" CssClass="TextLabel" Text="Xã/Phường/Thị trấn:" runat="server" />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc2:ValidationDropdownlist ID="ddlXaThiTranHienTai" Group="reg" AssociatedLableText="Xã thị trấn"
                                            CssClass="DropDownList" runat="server" DataType="required">
                                        </cc2:ValidationDropdownlist>
                                        &nbsp;<span style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="DivRow hidden">
                                    <div class="DivLabel">
                                        <asp:Label ID="lblDC2" CssClass="TextLabel" Text="Số nhà, đường phố/xóm/ấp/thôn:"
                                            runat="server" />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc1:ValidationTextBox ID="txtDiaChiHienTai" CssClass="TextBox" Group="reg" AssociatedLableText="Địa chỉ."
                                            runat="server" Text="" MaxLength="50" DataType="required"></cc1:ValidationTextBox>&nbsp;<span
                                                style="color: red">*</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <%--thong tin chung--%>
                        <div class="panel-heading">
                            <%--start .panel-heading thong tin ho kinh doanh --%>
                            <img src='<%=ResolveUrl("~/images/arrow-down.png")%>' border="0" align="absmiddle">
                            Đăng ký hộ kinh doanh với các nội dung sau
                        </div>
                        <div class="DivRow">
                            <div class="DivLabel">
                                <asp:Label ID="lblAddressKinhDoanhTitle" CssClass="TextLabel" Text="Địa chỉ kinh doanh:" runat="server" />
                            </div>
                            <div class="DivTextBox">
                                <cc1:ValidationTextBox ID="lblAddressKinhDoanh" CssClass="TextBox" Group="reg"
                                    AssociatedLableText="." runat="server" Text="" MaxLength="50" Width="450px"></cc1:ValidationTextBox>
                            </div>
                        </div>
                        <div class="panel-body">

                            <div class="DivRow hidden">
                                <div class="DivLabel">
                                    <asp:Label ID="lblTinhKD" CssClass="TextLabel" Text="Tỉnh/Thành phố:" runat="server" />
                                </div>
                                <div class="DivTextBox">
                                    <cc2:ValidationDropdownlist ID="ddlTinhDiaDiemKD" Group="reg" AssociatedLableText="Tỉnh"
                                        CssClass="DropDownList" runat="server" DataType="required">
                                    </cc2:ValidationDropdownlist>
                                    &nbsp;<span style="color: red">*</span>
                                </div>
                            </div>
                            <div class="DivRow hidden">
                                <div class="DivLabel">
                                    <asp:Label ID="lblHuyenKD" CssClass="TextLabel" Text="Quận/Huyện/Thị xã/Thành phố thuộc tỉnh:"
                                        runat="server" />
                                </div>
                                <div class="DivTextBox">
                                    <cc2:ValidationDropdownlist ID="ddlHuyenDiaDiemKD" Group="reg" AssociatedLableText="Huyện"
                                        CssClass="DropDownList" runat="server" DataType="required">
                                    </cc2:ValidationDropdownlist>
                                    &nbsp;<span style="color: red">*</span>
                                </div>
                            </div>
                            <div class="DivRow hidden">
                                <div class="DivLabel">
                                    <asp:Label ID="lblXaThiTranKD" CssClass="TextLabel" Text="Xã/Phường/Thị trấn:" runat="server" />
                                </div>
                                <div class="DivTextBox">
                                    <cc2:ValidationDropdownlist ID="ddlXaThiTranDiaDiemKD" Group="reg" AssociatedLableText="Xã thị trấn"
                                        CssClass="DropDownList" runat="server" DataType="required">
                                    </cc2:ValidationDropdownlist>
                                    &nbsp;<span style="color: red">*</span>
                                </div>
                            </div>
                            <div class="DivRow hidden">
                                <div class="DivLabel">
                                    <asp:Label ID="lblDiaDiemKD" CssClass="TextLabel" runat="server" Text="Số nhà, đường phố/xóm/ấp/thôn: " />
                                </div>
                                <div class="DivTextBox">
                                    <cc1:ValidationTextBox ID="txtBiz_HeadOffice" CssClass="TextBox" Group="reg" AssociatedLableText="Địa điểm kinh doanh."
                                        runat="server" Text="" MaxLength="50" DataType="required"></cc1:ValidationTextBox>&nbsp;<span
                                            style="color: red">*</span>
                                </div>
                            </div>
                            <div class="DivRow">
                                <div class="DivLeft">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label13" CssClass="TextLabel" runat="server" Text="Điện thoại: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:TextBox ID="txtOw_Tel" CssClass="TextBox" runat="server" Text="" />
                                    </div>
                                </div>
                                <div class="DivRight">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label14" CssClass="TextLabel" runat="server" Text="Fax: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:TextBox ID="txtOw_Fax" CssClass="TextBox" runat="server" Text="" />
                                    </div>
                                </div>
                                <div style="clear: both;">
                                </div>
                            </div>
                            <div class="DivRow">
                                <div class="DivLeft">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label15" CssClass="TextLabel" runat="server" Text="Email: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:TextBox ID="txtOw_Email" CssClass="TextBox" runat="server" Text="" />
                                    </div>
                                </div>
                                <div class="DivRight">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label16" CssClass="TextLabel" runat="server" Text="Website: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:TextBox ID="txtOw_WebSite" CssClass="TextBox" runat="server" Text="" />
                                    </div>
                                </div>
                                <div style="clear: both;">
                                </div>
                            </div>
                            <div class="DivRow">
                                <div class="DivLabel">
                                    <asp:Label ID="Label18" CssClass="TextLabel" runat="server" Text="Lĩnh vực kinh doanh: " />
                                </div>
                                <div class="DivTextBox">
                                    <cc2:ValidationDropdownlist ID="ddlBusinessField" Group="reg" AssociatedLableText="Lĩnh vực kinh doanh"
                                        CssClass="DropDownList" runat="server" DataType="required">
                                    </cc2:ValidationDropdownlist>
                                    &nbsp;<span style="color: red">*</span>
                                </div>
                            </div>
                            <div>
                                <!-- Phần thêm chi tiết -->
                                <div class="DivRow">
                                    <div class="row_subtitle">
                                        <div class="texttitle_sub">
                                            Ngành nghề kinh doanh
                                        </div>
                                        <div class="icon_arrow_sub">
                                            &nbsp;
                                        </div>
                                    </div>
                                    <%--<span id="clxp" style="cursor: pointer">
                        <img id="imgshowhide" alt="" src="images/arrow_showless.gif" /></span>--%>
                                    <div id="search" class="BoxField">
                                        <div class="form" id="form">
                                            <div class="SubjectTitle">
                                                <div class="DivTextBox">
                                                    <div runat="server" id="divChoices">
                                                        <table id='tableChoices' class="table table-bordered GridBorder" style="border-width: 1px; border-style: solid; width: 100%; border-collapse: collapse;"
                                                            width="100%">
                                                            <tr id='pRow' class="GridHeader">
                                                                <td width='20px' class='tdLabelT'>
                                                                    <b>STT</b>
                                                                </td>
                                                                <td width='300px'>
                                                                    <b>Chi tiết ngành nghề</b>
                                                                </td>
                                                                <td width='60px'>
                                                                    <b>Mã ngành nghề</b>
                                                                </td>
                                                                <td width='300px'>
                                                                    <b>Tên ngành nghề</b>
                                                                </td>
                                                                <%--<td  width='70px' nowrap="nowrap">
                                                                    &nbsp;
                                                                </td>--%>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                    <%--<input type="button" onclick="addFormField(); return false;" value="Thêm" class="btn btn-info" />--%>
                                                </div>
                                            </div>
                                            <div class="DivRow">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label8" CssClass="TextLabel" runat="server" Text="Vốn tiền mặt: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc1:ValidationTextBox ID="txtVonTienMat" onblur='getTotalCapital()' CssClass="TextBox"
                                            Group="reg" AssociatedLableText="Vốn tiền mặt." runat="server" Text="" MaxLength="15"
                                            DataType="required"></cc1:ValidationTextBox>&nbsp;<span style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label9" CssClass="TextLabel" runat="server" Text="Vốn tài sản: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc1:ValidationTextBox ID="txtVonTaiSan" onblur='getTotalCapital()' CssClass="TextBox"
                                            Group="reg" AssociatedLableText="Vốn tài sản." runat="server" Text="" MaxLength="15"
                                            DataType="required"></cc1:ValidationTextBox>&nbsp;<span style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label19" CssClass="TextLabel" runat="server" Text="Vốn kinh doanh: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <cc1:ValidationTextBox ID="txtBiz_InvestCapital" Enabled="false" CssClass="TextBox"
                                            Group="reg" AssociatedLableText="Vốn kinh doanh." runat="server" Text="" MaxLength="15"
                                            DataType="required"></cc1:ValidationTextBox>&nbsp;<span style="color: red">*</span>
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        <asp:Label ID="Label20" CssClass="TextLabel" runat="server" Text="Tiền viết bằng chữ: " />
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:Label ID="txtBiz_WordsMoney" runat="server" Text="" />
                                        <asp:TextBox ID="txtMoney_string" runat="server" Text="" Style="display: none;" />
                                    </div>
                                </div>
                                <!--TUANCD:2014/11/1: Thêm mục nhập danh sách góp vốn-->
                                <!-- Phần thêm chi tiết -->
                                <div class="DivRow">
                                    <div class="row_subtitle">
                                        <div class="texttitle_sub">
                                            Danh sách cá nhân góp vốn
                                        </div>
                                        <div class="icon_arrow_sub">
                                            &nbsp;
                                        </div>
                                    </div>
                                    <div id="Div1" class="BoxField">
                                        <div class="form" id="Div2">
                                            <div class="SubjectTitle">
                                                <div class="DivTextBox">
                                                    <div runat="server" id="div3">
                                                        <table id='tableChoices1' class="table table-bordered GridBorder" style="border-width: 1px; border-style: solid; width: 100%; border-collapse: collapse;"
                                                            width="100%">
                                                            <tr id='Tr1' class="GridHeader">
                                                                <td width='20px' class='tdLabelT'>
                                                                    <b>STT</b>
                                                                </td>
                                                                <td width='118px'>
                                                                    <b>Tên thành viên</b>
                                                                </td>
                                                                <td width='118px'>
                                                                    <b>Nơi đăng ký HK</b>
                                                                </td>
                                                                <td width='118px'>
                                                                    <b>Giá trị góp vốn</b>
                                                                </td>
                                                                <td width='118px'>
                                                                    <b>Tỷ lệ góp vốn</b>
                                                                </td>
                                                                <td width='118px'>
                                                                    <b>CMND</b>
                                                                </td>
                                                                <td width='118px'>
                                                                    <b>Ghi chú</b>
                                                                </td>
                                                                <td width='20px' nowrap="nowrap">&nbsp;
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                    <input type="button" onclick="addFormFieldDSGV(); return false;" value="Thêm" class="btn btn-info" style="display: none;" />
                                                </div>
                                            </div>
                                            <div class="DivRow">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div style="clear: both"></div>
                                <!--End TUANCD -->
                                <div class="row_subtitle">
                                    <div class="texttitle_sub">
                                        Thành phần hồ sơ
                                    </div>
                                    <div class="icon_arrow_sub">
                                        &nbsp;
                                    </div>
                                </div>
                                <div class="DivRow">
                                    <div class="DivLabel">
                                        &nbsp;
                                    </div>
                                    <div class="DivTextBox">
                                        <asp:GridView ID="grdShowTp" runat="server" AutoGenerateColumns="False" EmptyDataText="{Không có dữ liệu}"
                                            AllowPaging="false" Width='50%' BorderWidth="1px" CssClass="GridBorder">
                                            <Columns>
                                                <asp:TemplateField>
                                                    <HeaderStyle HorizontalAlign="Center" />
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chkItem" runat="server" />
                                                    </ItemTemplate>
                                                    <ItemStyle Width="15%" HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="STT">
                                                    <ItemTemplate>
                                                        <asp:Label runat="server" ID="lblSTT" Text=''></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle Width="15%" HorizontalAlign="Left" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField='TenHoSo' HeaderText='Tên Hồ sơ'>
                                                    <ItemStyle Width='70%' />
                                                </asp:BoundField>
                                            </Columns>
                                            <HeaderStyle Height="26px" HorizontalAlign="Left" CssClass="GridHeader" />
                                            <RowStyle CssClass="GridRow" Height="23px" />
                                            <AlternatingRowStyle CssClass="GridAlterRow" />
                                            <PagerStyle CssClass="GridPaged" HorizontalAlign="Right" Height="23px" />
                                            <PagerSettings Mode="Numeric" PageButtonCount="2" />
                                            <EmptyDataRowStyle CssClass="GridTextEmpty" HorizontalAlign="Center" />
                                        </asp:GridView>
                                    </div>
                                </div>
                                <div style="clear: both; height: 10px;"></div>
                            </div>
                            <div class="DivRow" style="display: none;">
                                <div class="DivLabel">
                                    &nbsp;&nbsp;&nbsp;
                                </div>
                                <div class="DivTextBox">
                                    <asp:Button ID="btnSave" runat="server" Text=" Lưu " CssClass="btn btn-info" CausesValidation="false" />
                                    <asp:Button ID="btnHuy" CausesValidation="false" runat="server" Text=" Hủy " CssClass="btn btn-info" />
                                </div>
                            </div>
                            <div style="display: none">
                                <asp:HiddenField ID="HiddenField2" Value="0" runat="server" />
                                <asp:HiddenField ID="HiddenField3" Value="0" runat="server" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="content_porletform" id="List" style="display: none;">
                <div class="HeadTitle">
                    <h3 class="text-center">HỒ SƠ BAO GỒM GIẤY TỜ
                    </h3>
                </div>
                <%--thong tin chung--%>
                <div class="box_contentform">
                    <div class="box_scroll_grid">
                        <%--thong tin chung--%>
                        <div class="panel-group margin-detail">
                            <div class="panel-body">
                                <asp:GridView ID="grdShow" runat="server" AutoGenerateColumns="False" EmptyDataText="{Không có dữ liệu}"
                                    AllowPaging="false" Width='100%' BorderWidth="1px" CssClass="GridBorder">
                                    <Columns>
                                        <asp:TemplateField HeaderText="STT">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblSTT" Text=''></asp:Label>
                                            </ItemTemplate>
                                            <ItemStyle Width="5%" HorizontalAlign="Left" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Tên giấy chứng nhận">
                                            <ItemTemplate>
                                                <asp:HyperLink ID="hplParentId" runat="server" Target="_blank"></asp:HyperLink>
                                            </ItemTemplate>
                                            <ItemStyle Width='15%' />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField='CertifiedCode' HeaderText='Giấy CN'>
                                            <ItemStyle Width='10%' />
                                        </asp:BoundField>
                                        <asp:BoundField DataField='CertifiedDate' HeaderText='Ngày cấp' DataFormatString='{0:dd/MM/yyyy}'>
                                            <ItemStyle Width='10%' />
                                        </asp:BoundField>
                                        <asp:TemplateField HeaderText="Hộ kinh doanh">
                                            <ItemTemplate>
                                                <asp:HyperLink ID="hplBiz_VietName" runat="server"></asp:HyperLink>
                                            </ItemTemplate>
                                            <ItemStyle Width='15%' />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField='Ow_Name' HeaderText='Người đại diện'>
                                            <ItemStyle Width='15%' />
                                        </asp:BoundField>
                                        <asp:BoundField DataField='Ow_CardID' HeaderText='CMND'>
                                            <ItemStyle Width='8%' />
                                        </asp:BoundField>
                                    </Columns>
                                    <HeaderStyle Height="26px" HorizontalAlign="Left" CssClass="GridHeader" />
                                    <RowStyle CssClass="GridRow" Height="23px" />
                                    <AlternatingRowStyle CssClass="GridAlterRow" />
                                    <PagerStyle CssClass="GridPaged" HorizontalAlign="Right" Height="23px" />
                                    <PagerSettings Mode="Numeric" PageButtonCount="2" />
                                    <EmptyDataRowStyle CssClass="GridTextEmpty" HorizontalAlign="Center" />
                                </asp:GridView>
                                <div style="clear: both; height: 5px">
                                </div>
                                <div>
                                    <%--<asp:Button ID="btnDelete" CssClass="btn" runat="server" Text="Xóa" />--%>
                                    <asp:Label ID="lblPage_Size" runat="server" Text="Số bản ghi trên trang:"></asp:Label>
                                    <asp:DropDownList ID="drpPage_Size" runat="server" AutoPostBack="True" Width="70px"
                                        CssClass="input_form">
                                        <asp:ListItem Text="10" Value="10"></asp:ListItem>
                                        <asp:ListItem Text="20" Value="20"></asp:ListItem>
                                        <asp:ListItem Text="50" Value="50"></asp:ListItem>
                                        <asp:ListItem Text="100" Value="100"></asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Label ID="lblTotal" runat="server"></asp:Label>
                                </div>
                                <div style="width: 100%">
                                    <!--phan trang-->
                                    <div id="results_resultsNavigationDiv" class="paginationEMP">
                                        <ul>
                                            <asp:LinkButton ID="lnkFirst" runat="server"></asp:LinkButton>
                                            <asp:Repeater ID="rptPage" runat="server">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="lnkTitle" CssClass="page_num" runat="server" OnClick="lnkTitle_Click"></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                            <asp:LinkButton ID="lnkLast" runat="server"></asp:LinkButton>
                                        </ul>
                                    </div>
                                    <asp:HiddenField ID="hidCount" Value="0" runat="server" />
                                    <asp:HiddenField ID="hidIndex_page" Value="0" runat="server" />
                                    <asp:HiddenField ID="hidCur_Page" Value="1" runat="server" />
                                </div>
                                <div style='display: none'>
                                    <asp:DropDownList ID="drpMessage" runat="server">
                                        <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản ghi này không?' Value='0'></asp:ListItem>
                                        <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản đã chọn?' Value='1'></asp:ListItem>
                                        <asp:ListItem Text='Bạn phải chọn ít nhất một bản ghi.' Value='2'></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div style="display: none">
                <asp:HiddenField ID="hidID" Value="0" runat="server" />
                <asp:HiddenField ID="HidUserName" Value="0" runat="server" />
            </div>
            <div style="display: none">
                <asp:HiddenField runat="server" ID="hidRowIndex" Value="0" />
                <asp:HiddenField ID="hidRowIndex1" Value="0" runat="server" />
                <asp:HyperLink ID="hplShowCertifiedHouseholdNganhNghe" runat="server" CssClass="thickbox"
                    NavigateUrl="~/FrontEnd/Page/Member/Popup.aspx?keepThis=true&TB_iframe=true&height=420&width=500&modal=true"></asp:HyperLink>
            </div>
            <div style="display: none">
                <input type="text" id="curId" />
                <input type="text" id="OriginalDeliveryDate" class="TextBox" />
                <asp:HiddenField ID="hidSafeOffice" Value="" runat="server" />
                <asp:TextBox ID="txtmaterialCode" Text="" runat="server" />
                <asp:HiddenField ID="hidSale_Unit" Value="2" runat="server" />
                <asp:TextBox ID="txtCustomer" runat="server" Text=""></asp:TextBox>
                <asp:TextBox ID="txtGrossAmount" runat="server" Text="0"></asp:TextBox>
                <asp:TextBox ID="txtMaterialDescription" runat="server" Text="" />
                <asp:TextBox ID="hidHuyenHienTai" runat="server" Text="" />
                <asp:TextBox ID="hidXaThiTranHienTai" runat="server" Text="" />
                <asp:TextBox ID="hidHuyenHoKhau" runat="server" Text="" />
                <asp:TextBox ID="hidXaThiTranHoKhau" runat="server" Text="" />
                <asp:TextBox ID="hidHuyenDiaDiemKD" runat="server" Text="" />
                <asp:TextBox ID="hidXaThiTranDiaDiemKD" runat="server" Text="" />
                <asp:HiddenField ID="hidCurHuyenId" runat="server" Value="" />
            </div>
    </ContentTemplate>
</asp:UpdatePanel>
